Convert To Any File MS Excel Can Save As

If MS Excel can open it, then we can easily convert it using the ‘MS Excel’ conversion method (/M1). Below we show how to convert a dBase IV (DBF) file to an HTML file. Because Excel can open this file type, we can convert it to any file type MS Excel can ‘Save As’. Modify the example below to tailor your needs by changing /F and /C to correspond to the proper input and output file types. NOTE: Although shown for consistency, /F is really not required and can be omitted.

 

Example 1: Convert a dBase IV File To Excel

To convert a single file from dBase IV (DBF) to a HTML use the following syntax:

 

ConvertXLS.EXE /S"C:\in\input.dbf" /T "C:\out\Final.HTM" /C44 /F11 /M1 /V

Next we show how to convert a whole folder (and subfolders /R) of text files (C:\abc\*.DBF) to XLS files located in the same folder. The following syntax would be used for such a case:

 

ConvertXLS.EXE /S"C:\abc\*.dbf" /T "C:\abc\*.HTM" /C44 /F11 /M1 /R /V

 

·      The /S and /T switches above specify Source (input) and Target (output) path respectively and are both required when converting a single file. It is always a good idea to use double quotes around the path especially if there are space characters within the path.

·      The /C and /F switch specifies the output and the input file type respectively. See Excel Conversion File Type Constants for all possible values for /C and /F.

·      The /M2 switch tells it to use the ‘Convert XLS’ conversion method which is exceptionally fast and allows for the specification of each columns width. /M1 switch is used to specify the ‘MS Excel’ conversion method which is a bit slower and requires MS Excel. For these examples, only /M1 will work.

·      The /R switch tells it to search the input folder and its subfolders for files to convert.

·      The /V (for Verbose) switch is used to give instant feedback by having the program report the status of the conversion with a message box. You can remove this once you have perfected your command line specification. You can also (or instead of /V) create a Log file that will contain the results of the conversion by using the /L switch.

Note: It is highly encouraged that you use the Verbose (/V) switch initially to see what the status of your conversion is and to help you perfect your command line. When in verbose mode the program will tell you what went wrong or right with your command line using message boxes.